package p270jp.pxv.android.view;

import android.content.Context;
import android.util.AttributeSet;
import android.view.LayoutInflater;
import android.view.View;
import androidx.databinding.DataBindingUtil;
import p045be.View$OnClickListenerC1095o;
import p090d0.C2518n;
import p134ei.AnalyticsAction;
import p144f1.C3017s;
import p184gi.AnalyticsParameter;
import p184gi.FirebaseAnalyticsEventName;
import p270jp.pxv.android.R;
import p270jp.pxv.android.legacy.model.PixivIllust;
import p314lg.ViewThumbnailBinding;
import p374nm.BaseMuteLayout;
import p677zi.PixivImageLoader;

/* renamed from: jp.pxv.android.view.ThumbnailView */
/* loaded from: classes2.dex */
public class ThumbnailView extends BaseMuteLayout {

    /* renamed from: e */
    public static final /* synthetic */ int f19696e;

    /* renamed from: b */
    public ViewThumbnailBinding f19697b;

    /* renamed from: c */
    public final PixivImageLoader f19698c = (PixivImageLoader) C2518n.m7641d(PixivImageLoader.class);

    /* renamed from: d */
    public boolean f19699d;

    public ThumbnailView(Context context) {
        super(context);
    }

    @Override // p374nm.BaseMuteLayout
    /* renamed from: a */
    public View mo3337a() {
        ViewThumbnailBinding qbVar = (ViewThumbnailBinding) DataBindingUtil.m11370c(LayoutInflater.from(getContext()), R.layout.view_thumbnail, this, false);
        this.f19697b = qbVar;
        return qbVar.f2666e;
    }

    /* renamed from: c */
    public void m4465c() {
        this.f19697b.f22166w.setBackgroundResource(R.drawable.bg_top_right_round_gray);
        this.f19697b.f22160q.setBackgroundResource(R.drawable.bg_top_right_round_gray);
        this.f19697b.f22162s.setImageResource(R.drawable.ic_yellow_mark_left_top_round);
    }

    /* renamed from: d */
    public void m4464d(String str, int i) {
        this.f19698c.m53m(getContext(), str, this.f19697b.f22163t, i);
    }

    /* renamed from: e */
    public void m4463e() {
        this.f19697b.f22162s.setImageResource(R.drawable.ic_yellow_mark_left_top_round);
    }

    /* renamed from: f */
    public void m4462f() {
        this.f19697b.f22166w.setBackgroundResource(R.drawable.bg_top_right_round_gray);
        this.f19697b.f22160q.setBackgroundResource(R.drawable.bg_top_right_round_gray);
    }

    public void setAnalyticsParameter(AnalyticsParameter cVar) {
        this.f19697b.f22164u.setAnalyticsParameter(cVar);
    }

    public void setDislikeAnalyticsAction(AnalyticsAction aVar) {
        this.f19697b.f22164u.setDislikeAnalyticsAction(aVar);
    }

    public void setIgnoreMuted(boolean z) {
        this.f19699d = z;
    }

    public void setIllust(PixivIllust pixivIllust) {
        if (C3017s.m6470f(pixivIllust, this.f19699d)) {
            setMuteCoverVisibility(0);
            return;
        }
        setMuteCoverVisibility(8);
        if (1 < pixivIllust.pageCount) {
            setVisibilityPageCount(0);
            this.f19697b.f22166w.setText(String.valueOf(pixivIllust.pageCount));
        } else {
            setVisibilityPageCount(8);
        }
        if (pixivIllust.getIllustType() != PixivIllust.Type.MANGA || pixivIllust.series == null) {
            this.f19697b.f22161r.setVisibility(8);
            this.f19697b.f22161r.setOnClickListener(null);
        } else {
            this.f19697b.f22161r.setVisibility(0);
            this.f19697b.f22161r.setOnClickListener(new View$OnClickListenerC1095o(this, pixivIllust, 12));
        }
        if (pixivIllust.getIllustType() == PixivIllust.Type.UGOIRA) {
            this.f19697b.f22160q.setVisibility(0);
        } else {
            this.f19697b.f22160q.setVisibility(8);
        }
        this.f19697b.f22164u.setWork(pixivIllust);
    }

    public void setImage(String str) {
        this.f19698c.m57i(getContext(), str, this.f19697b.f22163t);
    }

    public void setLikeButtonEnabled(boolean z) {
        if (z) {
            this.f19697b.f22164u.setVisibility(0);
        } else {
            this.f19697b.f22164u.setVisibility(8);
        }
    }

    public void setLikeEventName(FirebaseAnalyticsEventName jVar) {
        this.f19697b.f22164u.setLikeEventName(jVar);
    }

    public void setVisibilityIconUgoira(int i) {
        this.f19697b.f22160q.setVisibility(i);
    }

    public void setVisibilityPageCount(int i) {
        this.f19697b.f22166w.setVisibility(i);
    }

    public ThumbnailView(Context context, AttributeSet attributeSet) {
        super(context, attributeSet);
    }
}
